package com.itheima.d3_thread_safe;

public class Ticket implements Runnable {
    private int  ticker = 100;
    @Override
    public void run() {
        while (true){
            if (ticker <=0){
                break;
            }else {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                ticker --;
                System.out.println(Thread.currentThread().getName()+ "窗口剩余票数"+ticker);
            }
        }
    }
}
